<html>
<head>
<title>Add hilite_index_carousel</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link media="all" href="/cms/css/cms.min.css" type="text/css" rel="stylesheet" /> 
<link rel="stylesheet" type="text/css" href="/cms/css/tag/token-input.css" />
<script  type="text/javascript" src="/cms/js/cms.1.1.min.js"></script>
<script type="text/javascript" src="/cms/js/tag/jquery.tokeninput.js"></script> 
<script language="JavaScript" src="/cms/js/cleditor/jquery.cleditor.min.js"></script>
<script language="JavaScript" src="/cms/js/jquery.validate.js"></script>
<script language="JavaScript" src="/cms/js/autocomplete/textarea.js"></script>

</head>

<body>
{#include file="$navigation"#}
<div style="float:right;" id="login"></div>

<script>
$(document).ready(function() {	

});	
  function validate_form(form){
	  if (validator.form())  form.submit(); else alert('Some fields has error. Please check and resubmit');
  }
</script>

<H1><span id="parent_key_label"></span>Hilite index carousel</H1>
<form name="form_showadd" method="post" id="form_showadd" action="{#$self_url#}" enctype="multipart/form-data">	
<div class='tableWrapper' style="width:100%;margin:0;padding:0;">
  <div class='tableHeader' >

	<ul class="tableActions">
  <li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" name="Submit" value=" 儲存 " onclick="form.subaction.value='edit_after_add'; form.submit();" type="button"></li><li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" type="submit" name="Submit" value=" 確定 "></li><li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" name="Submit" value=" 儲存並新增 " onclick="form.subaction.value='showadd_after_add'; form.submit();" type="button"></li><li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" name="dummy" value=" 取消 " size="3" onclick="javascript:window.location.href='{#$self_url#}/list'" type="button"></li>
	</ul>

  <div class='clear'></div>
  <div class='corner left'></div>
  <div class='corner right'></div>
  </div>	
<table border="0" cellspacing='0' >

<tr id="tr_title"><td><B>標題</B></td>
<td id="td_title"><input id="field_title" type="text" name="title" size="80" value=""></td></tr>
<tr id="tr_photo"><td><B>photo</B></td>
<td id="td_photo"><input type="file" name="photo"> ( 支持：jpg,gif,jpeg,png)<label><input type="checkbox" name="photo_clear" value="1" />清除</label><br/><BR/>
<div id="photo_geometry"></div><SCRIPT type=text/javascript>
$(document).ready(function() {
$.jcrop_cms("photo_geometry",  
"{#$showadd_data.photo_image2#}"+'?'+Math.floor(Math.random()*9999+1),  "{#$showadd_data.photo_imagesize2#}",  //src image and size
"{#$showadd_data.photo_imageparam1#}", "{#$showadd_data.photo_imagesize1#}" , // current thumbnail size
"183x125",  // ps assign size
"photo_crop_param1",
"photo_thumbnailsize1", "0");
});</script><BR/>大圖： 470x250<BR/>小圖 經大圖剪裁（183x125）</td></tr>
<tr id="tr_url"><td><B>網址</B></td>
<td id="td_url"><input id="field_url" type="text" name="url" size="80" value=""></td></tr>
<tr id="tr_priority"><td><B>優先順序(大至小）</B></td>
<td id="td_priority">{#$showadd_data.priority#}</td></tr>
<tr id="tr_starttime"><td><B>開始時間</B></td>
<td id="td_starttime"><input type="text" name="starttime" value="{#$showadd_data.starttime#}" id="datepicker_starttime">
<script type="text/javascript">  
$(function() {  
    $('#datepicker_starttime').datepicker({  
        duration: '',  
        showTime: true,  
        constrainInput: false,  
        stepMinutes: 1,  
        stepHours: 1,          
        altTimeField: '',  
        dateFormat:'yy-mm-dd',
        time24h: true  
     });  
});  
</script>

</td></tr>
<tr id="tr_endtime"><td><B>結束時間</B></td>
<td id="td_endtime"><input type="text" name="endtime" value="{#$showadd_data.endtime#}" id="datepicker_endtime">
<script type="text/javascript">  
$(function() {  
    $('#datepicker_endtime').datepicker({  
        duration: '',  
        showTime: true,  
        constrainInput: false,  
        stepMinutes: 1,  
        stepHours: 1,          
        altTimeField: '',  
        dateFormat:'yy-mm-dd',
        time24h: true  
     });  
});  
</script>

</td></tr>
<tr id="tr_status"><td><B>上線狀態</B></td>
<td id="td_status">{#$showadd_data.status#}</td></tr>

  <tr>
    <td>&nbsp;</td>
    <td>
     	
    <input type="hidden" name="action" value="add"><input name="subaction" type="hidden">
     <ul class="tableActions">
    <li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" name="Submit" value=" 儲存 " onclick="form.subaction.value='edit_after_add'; form.submit();" type="button"></li><li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" type="submit" name="Submit" value=" 確定 "></li><li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" name="Submit" value=" 儲存並新增 " onclick="form.subaction.value='showadd_after_add'; form.submit();" type="button"></li><li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" name="dummy" value=" 取消 " size="3" onclick="javascript:window.location.href='{#$self_url#}/list'" type="button"></li>
    </ul>
  </td>
  </tr>
</table>

</form>

<script type="text/javascript"> 	
$(function(){
  $(".tips").tipTip({defaultPosition: "right", edgeOffset: 10});
}); 
</script>

<script type="text/javascript">
$(document).ready(function() {	
	var now = new Date();

	if ($('#datepicker_starttime').val() == ''){
		var start = now.getFullYear() + '-' + parseInt(now.getMonth()+1) + '-' + now.getDate() + ' ' + now.getHours() + ':' + now.getMinutes();
		$('#datepicker_starttime').val(start);
	}
	
	if ($('#datepicker_endtime').val() == ''){
		now.setMonth( now.getMonth( ) + 1 );
		var end = now.getFullYear() + '-' + parseInt(now.getMonth()+1) + '-' + now.getDate() + ' ' + now.getHours() + ':' + now.getMinutes();
		$('#datepicker_endtime').val(end);
	}
});

</script> 
<!--POSTRUNJS-->
</body>
</html>
